package dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class AddNotificationDao {
	public boolean addnotifaction(String title, String content,int dormitoryId,String username) throws ClassNotFoundException, SQLException {
		Connection conn = DBUtil.getConnection();
		PreparedStatement ps = conn.prepareStatement("insert into Notification(title,notificationcontent,dormitoryid,username) values(?,?,?,?)");
		ps.setString(1, title);
		ps.setString(2, content);
		ps.setInt(3,dormitoryId);
		ps.setString(4,username);
		ps.execute();
		boolean res = true;
		ps.close();
		conn.close();
		System.out.println(res);
		return res;
		
	}
}
